package com.example.cms.AuthUtils;

public class AuthUtil {

    /**
     * 检查是否有权限访问患者功能
     */
    public static boolean canAccessPatientFeatures(String role) {
        return "DOCTOR".equals(role) || "ADMIN".equals(role);
    }

    /**
     * 检查是否有权限访问医生功能
     */
    public static boolean canAccessDoctorFeatures(String role) {
        return  "ADMIN".equals(role);
    }

    /**
     * 检查是否有权限访问管理员功能
     */
    public static boolean canAccessAdminFeatures(String role) {
        return "ADMIN".equals(role);
    }

    /**
     * 获取角色显示名称
     */
    public static String getRoleDisplayName(String role) {
        switch (role) {
            case "PATIENT": return "患者";
            case "DOCTOR": return "医生";
            case "ADMIN": return "管理员";
            default: return "未知";
        }
    }
}
